package cw.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

public class Log {
	public static void write(String str) {
		try {
			String fileName = "log.txt";
			File file = new File(fileName);
			FileWriter fw = new FileWriter(file, true);
			
			PrintWriter pw = new PrintWriter(fw);
			pw.println(str+new Date().toLocaleString());
			
			pw.flush();
			fw.flush();
			pw.close();
			fw.close();

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
